const { contextBridge, ipcRenderer } = require('electron')

contextBridge.exposeInMainWorld('electronAPI', {
  // 系统通知
  showNotification: (options) => ipcRenderer.invoke('show-notification', options),
  
  // 角标管理
  setBadgeCount: (count) => ipcRenderer.invoke('set-badge-count', count),
  
  // 开机自启
  setAutoLaunch: (enabled) => ipcRenderer.invoke('set-auto-launch', enabled),
  getAutoLaunch: () => ipcRenderer.invoke('get-auto-launch'),
  
  // 窗口控制
  minimizeToTray: () => ipcRenderer.invoke('minimize-to-tray'),
  quitApp: () => ipcRenderer.invoke('quit-app'),
  
  // 事件监听
  onNotificationClicked: (callback) => ipcRenderer.on('notification-clicked', callback),
  onNavigateTo: (callback) => ipcRenderer.on('navigate-to', callback),
  
  // 移除监听器
  removeAllListeners: (channel) => ipcRenderer.removeAllListeners(channel)
})